<div class="layui-fluid">
  <div class="layui-card">
    <div class="layui-card-body">
        <fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
          <legend>订单信息</legend>
        </fieldset>
        <div class="layui-form">
          <table class="layui-table">
            <colgroup>
              <col width="150">
              <col >
              <col width="150">
            </colgroup>
            <tbody>
              <tr>
                <th>订单编号</th>
                <td><?=$info['order_no']?></td>
                <th>收货人姓名</th>
                <td><?=$info['sh_name']?></td>
                <th>下单人ID</th>
                <td><?=$user['id']?></td>
              </tr>
              <tr>
                <th>订单总价</th>
                <td><?=$no_info['order_total_money']?></td>
                <th>收货人地址</th>
                <td><?=$info['sh_address']?></td>
                <th>下单人姓名</th>
                <td><?=$user['username']?></td>
              </tr>
              <tr>
                <th>下单时间</th>
                <td><?php echo date("Y-m-d",$info['create_time'])?></td>
                <th>收货人电话</th>
                <td><?=$info['sh_phone']?></td>
                <th>下单人电话</th>
                <td><?=$user['phone']?></td>
              </tr>
            </tbody>
          </table>
        </div>
        <fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
          <legend>商品列表</legend>
        </fieldset>
        <div class="layui-form">
          <table class="layui-table">
            <colgroup>
              <col width="100">
              <col width="110">
              <col width="300">
              <col width="300">
              <col width="100">
              <col width="100">
              <col width="100">
            </colgroup>
            <thead>
              <tr>
                <th>商品缩略图 </th>
                <th>商品名称</th>
                <th>规格名称</th>
                <th>商品数量 </th>
                <th>商品单价 </th>
                <th>商品价格 </th>
                <th>状态</th>
              </tr>
            </thead>
            <tbody>
              <tr>
                <th><a href="<?=$info["pic"]?> "><img src="<?=$info["pic"]?>"/></a></th>
                <td><?=$info["title"]?></td>
                <td><?=$info["goods_price_title"]?></td>
                <td><?=$info["nums"]?></td>
                <td><?=$info["goods_price_price"]?></td>
                <td><?=$info["total_money"]?></td>
                <td><?php echo c("type.refund_status")[$info['refund_status']] ?></td>
              </tr>
            </tbody>
          </table>
        </div>
    </div>
    <div class="layui-form-item">
      <div class="layui-input-block">
        <button onclick='refund(2)' class="layui-btn">同意退款</button>
        <button onclick='refund(0)' class="layui-btn layui-btn-primary">不同意退款</button>
      </div>
    </div>
  </div>
</div>
<script>
  layui.use(['form'], function() {
    var $ = layui.$,
      form = layui.form;
    form.render();

    var ue = UE.getEditor('container');
  });

  function refund(type){
      layer.confirm('确认要执行该操作吗?', function(index){
          $.ajax({
              url:"/refund/detail",
              method:"post",
              dataType:"json",
              data:{id:<?=$info["id"]?>,type:type},
              success:function(res){
                  my.action(res);
                  layer.close(index);
              }
          });
      });
  }
</script>
